Forum Discussion
So im trying the following added code on the property itself, oneditfinish event and i will get the following error[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:51e5b6c0-f8dd-4c91-a76d-0800bbabd927:type=text&text=%20var%20SDRLMDID%20%3D%20document.thisItem.getProperty%28%22vsy_did_master%22%2C%22%22%29%3B%20%0D%0A%20var%20SDID%20%3D%20this.getInnovator%28%29.getItemById%28%22Supplier%20DID%22%2C%20SDRLMDID%29%3B%0D%0A%20if%20%28SDID.getItemCount%28%29%3D%3D1%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20this.setProperty%28%22vsy_first_delivery%22%2C%20SDID.getAttribute%28%22id%22%29%29%3B%0D%0A%20%20%20%20%20%20this.setPropertyAttribute%28%22vsy_first_delivery%22%2C%20%22keyed_name%22%2C%20SDID.getProperty%28%22keyed_name%22%2C%20%22%22%29%29%3B%0D%0A%20%20%20%20%7D]
You cannot use document.thisItem outside the context of a Form. Better try "this". Or take a look at "PE_SetTeam" which is maybe the better sample in your case.
Otherwise show screenshots of the situation cause I really don´t know what you try to do ;-)
Edit: My sample Methods where intended as onAfterNew "Client Events" not as property events. So beware!
- hkhan4 years agoCreator II
okay so ill rephrase the issue again:
There are two items Master DID and SDRL
Both these item contains a property called first_delivery which is a string data type.
Supplier DID has a property called master_did which is an item property links to Master DID item.
There is a third item called subcontract, when the user creates a new SDRL from the relationship in subcontract item and select master_did I want first_delivery to be populated instantly from Master DID before saving.
Please not: it cannot be foreign property as it should be editable
Following are the screen shots.
- Gopikrishnan4 years agoAccelerator II
Hi HKhan
Attach this method to DID Master Property - OnEditFinsh
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:60f3dc3d-368a-47ea-a215-f2e3115e6f3b:type=javascript&text=let%20selectedMasterDID%20%3D%20gridApplet.cells%28relationshipID%2C%20colNumber%29.getValue%28%29%3B%0D%0Aif%28selectedMasterDID%29%0D%0A%7B%0D%0Avar%20getMasterDID%20%3D%20aras.getItemById%28%22Master%20DID%22%2C%20selectedMasterDID%29%3B%0D%0AsetRelationshipProperty%28relationshipID%2C%20%27first_delivery%27%2C%20aras.getItemProperty%28getMasterDID%2C%20%22first_delivery%22%2C%22%22%29%29%3B%20%2F%2FIf%20first_delivery%20property%20is%20in%20relationship%20then%20use%20this%20line%0D%0AsetRelatedItemProperty%28relationshipID%2C%20%27first_delivery%27%2C%20aras.getItemProperty%28getMasterDID%2C%20%22first_delivery%22%2C%22%22%29%29%3B%20%2F%2F%20If%20first_delivery%20property%20is%20in%20Related%20Item%20then%20use%20this%20line%0D%0A%7D]
- hkhan4 years agoCreator II
hello
I am getting the following error when i apply this, any idea why? relateditem seems to be defined already