Skip to main content

Hi,

I created an initial SmartObject connected to a SharePoint List.  Now I moved the project containing the SmartObjects to another machine.  The other machine too have the same list running on the local SharePoint site.  Now when I try to deploy these SmartObjects I get the following error

 

 Error    1    Deploy smartobjects: Task error: SmartObjectServer Exception: Dependancy could not be created. Parent does not exist in this environment. Check Data property of exception.
Parent ID = 'ab891a10-4fe3-4dd7-8059-cf0123673317'
Parent Name = 'Library Books'
Parent Version = ''
Parent Extra Data = 'SourceCode.SmartObjects.Services.SharePoint.SharePointService'

    C:Written ProgramsLibrarySystemLibrarySystemSmartObjectsLSSmartObjectsobjDebugDeploymentLSSmartObjects.msbuild    60    6    LSSmartObjects

 Looks like its referring to the previous SharePoint list.  Could someone tell me how to modify these SmartObjects so that they will not work with the new SharePoint list on the new machine?

 

Thanks

ARjuna.

This occurs because the SmartObject binds to the service instance based on a GUID.  Dynamic service objects like the SharePoint service generate a new GUID every time a new instance is added.  Thus when you move from one system to another, the the names of the service instances may be the same, but the GUIDs are different.  Take a look at this blackmarket project utility that will update the GUIDs in your SmartObject:


http://www.k2underground.com/k2/ProjectHome.aspx?ProjectID=25


 I'm working on a utility that takes a different approach to this problem and hope to have it posted in a few weeks.


 


Thanks for the information.  But is there no other way of solving this problem without using a tool.  I mean K2 should have some inbuilt mechanism of its own in solving this issue?

Assuming thre is no inbuilt solution solution, so if I have a development environment where each developer has his own SharePoint List (same list different GUID) running on his/her local machine, then how do I solve this problem.  Does this mean that each time a developer checks out a SmartObject this tool has to be run on the SmartObject. 


Arjunam,


I have been pondering this issue myself lately.  I am writing a utility that I plan on posting on blackmarket that allows you to change the GUID of an existing service instance.  For your case, that means each of your developers could have their own environment and SharePoint list.  They would add an instance for the list to the SharePoint service object like they normally do.  Then they could use my new utility to change the GUID of their instance to match the service instance GUID of the of the person who created the SmartObject.  That way, when they check out the SmartObject they will not have to change it because the GUIDs would match.  In a sense, it allows you to synchronize the service instance GUIDs between machines. 


One note of caution:  If you already have deployed SmartObjects based on a ServiceInstance, you won't be able to change the service instance GUID because that would invalidate existing SmartObjects. 



The utility isn’t quite ready for posting, but if you send me a private email by using the link on this site, I’ll send you what I have.  You can try it out and give me some feedback.  Since it is still in the early stages, I you should not use it on a production environment.  If you don’t want a preview, I should have it on blackmarket in a couple of weeks.


Like all utilities posted on blackmarket, this is provided as a sample and is not supported by the helpdesk.


FYI, DavidL just released a utility on the blackmarket called "Service Instance Synchronizer Utility Home" that can assist with SmartObject portability across environments. It can be found at: http://www.k2underground.com/k2/ProjectHome.aspx?ProjectID=71)


As described there:


"This simple utility allows you to easily change the GUID of an existing service instance. When you create a SmartObject that uses a service instance, the SmartObject binds to the GUID of the service instance, not the name. When you move to another environment, if the service instance is created dynamically or you don’t specify a GUID when you register it, a GUID will be generated for you. When the GUIDs don’t match SmartObject deployment will fail with “Deploy smartobjects: Task error: SmartObjectServer Exception: Dependancy could not be created. Parent does not exist in this environment. Check Data property of exception.” Use this utility to quickly change the service instance GUID to match your other environment."


 


Hello All,


I'm running into this same issue.  I've downloaded the Service Instance Synchronizer, but when I use it I get the message:


"The GUID could not be changed becaus there are SmartObjects dependent on the current GUID"


 Any ideas?


In that case you may need to take a different route and change the Service Instance GUID within the SmartObject SODX.  That is what the first utility mentioned in this thread does (http://www.k2underground.com/k2/ProjectHome.aspx?ProjectID=25).

Reply