SOProtocol: Open dialog and automatically add person, company and sale
Hi,
We are working from a webpanel on the SuperOffice logo, and we need to open the dialog window to create a new appointment with pre-filled data.
We can open up specific appointments just fine with:
SuperOffice.ClientCrossMessaging.executeSoProtocol('appointment.main[new=true]?appointment_id=0&sale_id=12345');
How can this be achived?
Regards
Pär Pettersson
Allt Svar (11)
Hello Pär,
David is almost correct, and our documentation does not state that you can add sale_id.
But, you can use the `usesalecurrent=true`, which will let you set the sale_id. So you should be able to do this:
postMessage({ command: "soprotocol", arguments: "appointment.main[new=true]?appointment_id=0&sale_id=1&usesalecurrent=true" });
Sorry if this is a little confusing, I'm currently working on rewriting this part of our documentation to (hopefully) make it more clear.
Have a SUPER day!
//Eivind
Hi again,
One would guess that the same goes for the Document dialog, but, it does not.
How do we achive the exact same thing for Documents?
Pär
Thanks for the link, although, does not work.
Hello Par,
Sorry, but while rewriting this section on docs we discovered a couple of bugs/issues which we are still trying to figure out..
It has to do with how the old pagebuilder worked, and how it now is SCIL-based instead, and I see some of the issues are still not resolved completely.
The tl;dr is that you cant do the same for document as you can on followup, as the usersalecurrent/useprojectcurrent dont exist there..
A bonus-quirk is that if you are currently on a sale in SuperOffice, then you are able to set default sale (as you are trying to do) in the document-dialog.
Sorry!
//Eivind
Ok good to know, thanks.
If you remember, and when this is fixed, please let me know in this thread :)
(We are releasing activity+document support in Salesboard today (an App), and the last key was to be able to set the Sale in the document dialog directly by an ID)
But, as long as we know, we can ship everything else, so all good :)
Regards
Pär
Another issue, it does not really seem to be possible to load documents?
According to the documentation it should be: document.main?document_id=X
But, it just opens the last document open in S&M, not the actuall documents with that id.
document.main[refresh=true]?document_id=X does not work either.
Any suggestion?
Regards
Pär
Hello Pär,
This works for me, in SOD:
postMessage({ command: "soprotocol", arguments: "document.main?document_id=3" });
In what context are you executing this command? I've tried to execute it while standing on company, sale and project, but maybe there is something with how/where you are in the application?
//Eivind
Got it working with: SuperOffice.ClientCrossMessaging.openDocument(id);
The postMessage didnt do anything, i guess its because of Cors since the code is running from another domain in an webpanel on the superoffice logo.
All good, thanks alot for your fast response!
Regards
Pär Pettersson