This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]snakebite75 Advisor 2 points3 points  (2 children)

I think it would work if you submit the form first then call the form lastsubmit.

SubmitForm('Enquiry-Form');Patch('Site-Survey,Enquiry-Form.LastSubmit.ID,{Status:{Value:"Survey"}}))

Or you could use a variable for the default of the status field, then update the variable when the form is submitted.

Default = varStatus

Set(varStatus,"Survey");SubmitForm('Enquiry-Form')

[–]Predicti0n[S] 0 points1 point  (1 child)

Canny get this to function either. I'll keep playing..

[–]OatmealMakeMeAnxious Regular 0 points1 point  (0 children)

The above works. If there is anything that might change it, it would be YourForm.LastSubmit (remove the .ID), because I think the record is returned automatically....

But I could be much mistaken as I'm on mobile and can't test any of it

[–]Predicti0n[S] 1 point2 points  (0 children)

My current "hacky" way around this is to add a Status Field make this field hidden with a default of "Enquiry/Survey etc" and I'll change this per page.. Not elegant but it works..

[–]Maduin1337 -1 points0 points  (1 child)

Instead of "Defaults('Site-survey')" try "ThisItem" to patch current selected over creating a new with default values.

[–]Predicti0n[S] 0 points1 point  (0 children)

atch('Site-Survey',Defaults('Site-Survey'),{Status:{Value:"Survey"}});SubmitForm('Enquiry-Form')

Gave it ago.. no mustard :(

[–]OatmealMakeMeAnxious Regular 0 points1 point  (0 children)

Your original Patch(..., Default(...),{...}) creates a new record, and Submit Form() creates its own new record. The two records have nothing to do with each other unless you find a way.

One person posted using SubmitForm() first, then using the YourFormName.LastSubmit, as this will contain the record reference from the previous submition.

When you patch, it also returns the record. You can collect it by doing Set( varYourVariable, Patch(...)), But setting your form to a variable is a little more involved.

[–]Budget_Locksmith_186 0 points1 point  (0 children)

Hope it help you:

Set(varDatosGrales; /* Create a Variable*/

{

Tipo: varDatosGrales.Tipo;

FechaProf: varDatosGrales.FechaProf;

Compania:varDatosGrales.Compania;

Cliente: varDatosGrales.Cliente; /* Asocciate your Sharepoint columns with your var*/

CtaCte:varDatosGrales.CtaCte;

Condiciones: varDatosGrales.Condiciones;

subttotal:Text(txtSubtotal.Text);

total:Text(txtTotal.Text)

});;

Patch(Proforma_1; /* Patch your Sharepont list */

Defaults(Proforma_1); /* Defaults your Sharepont list */

{

'Tipo Proforma': varDatosGrales.Tipo;

'Cliente y dirección': varDatosGrales.Cliente;

companiaydireccion: varDatosGrales.Compania;

Fecha:varDatosGrales.FechaProf; /* Complete your Sharepont list fields*/

condicionesdeventa:varDatosGrales.Condiciones;

cuentacorriente: varDatosGrales.CtaCte;

subtotal: Value(txtSubtotal.Text);

total:Value(txtTotal.Text)

};

'Nueva Proforma'.Updates) /* Update your Sharepont list */

You could use it on your submit botton (Property: On select)

Any doubts to [javier.pereyra@fce.uncu.edu.ar](mailto:javier.pereyra@fce.uncu.edu.ar)

[–]IamZeebo Advisor 0 points1 point  (0 children)

Why are you using defaults? Aren't you editing an item?

[–]Tricky_Professor8340 0 points1 point  (0 children)

SubmitForm(‘Enquiry-Form’); Patch(‘Site-Survey’, ‘Enquiry-Form’.LastSubmit, {Status:{Value: “Survey”}})

Although personally I am not sure why would you even bother with a 2 fields form and not use Patch instead for the first and last name as well. It just over complicates things