ERPNEXT API - SET_VALUE not working

Hello guys,

i am using the ERPNEXT API, i am trying to set the value of a field into the database, but it is not being set.

but i am able to retreive the data, i dont understand what is going on. retreive is working but update is not working.

however there is no error during the process.

https://docs.erpnext.com/web-service-api

i am following this as the guide.

Thanks
Syed



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/9ab548d8-73ee-4e88-9342-b74759347fa2%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Are you using a POST ? If you use GET the transaction is not committed.

Also this is the updated guide:

https://frappe.io/apps/frappe-framework/developers/api/rest_api


On 11-Jun-2014, at 6:40 pm, Syed Qadeer <sd...@gmail.com> wrote:

Hello guys,

i am using the ERPNEXT API, i am trying to set the value of a field into the database, but it is not being set.

but i am able to retreive the data, i dont understand what is going on. retreive is working but update is not working.

however there is no error during the process.

https://docs.erpnext.com/web-service-api

i am following this as the guide.

Thanks
Syed



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/9ab548d8-73ee-4e88-9342-b74759347fa2%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/D62AB89F-A7F6-43BD-B2BC-09446142F869%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.

Hello Guys,

whenever i am trying to do the POST using the client, i am getting the following redirection script

<html><head><script>window.location.href='index.html';</script></head></html>

i dont understand, how the GET can work , and why not the POST

i am using the FormUrlEncodedContent when doing the POST,

please help.Thanks.

On Wednesday, 11 June 2014 16:10:01 UTC+3, Syed Qadeer wrote:
Hello guys,

i am using the ERPNEXT API, i am trying to set the value of a field into the database, but it is not being set.

but i am able to retreive the data, i dont understand what is going on. retreive is working but update is not working.

however there is no error during the process.

https://docs.erpnext.com/web-service-api

i am following this as the guide.

Thanks
Syed
 



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/036349a8-c10c-4cec-abbc-9ec843add09e%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
POST parameters are not sent in the URL, but in the body

Can you share your code snippet?


@rushabh_mehta

On 13-Jun-2014, at 5:20 pm, Syed Qadeer <sd...@gmail.com> wrote:


Hello Guys,

whenever i am trying to do the POST using the client, i am getting the following redirection script

<html><head><script>window.location.href='index.html';</script></head></html>

i dont understand, how the GET can work , and why not the POST

i am using the FormUrlEncodedContent when doing the POST,

please help.Thanks.

On Wednesday, 11 June 2014 16:10:01 UTC+3, Syed Qadeer wrote:
Hello guys,

i am using the ERPNEXT API, i am trying to set the value of a field into the database, but it is not being set.

but i am able to retreive the data, i dont understand what is going on. retreive is working but update is not working.

however there is no error during the process.

https://docs.erpnext.com/web-service-api

i am following this as the guide.

Thanks
Syed
 



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/036349a8-c10c-4cec-abbc-9ec843add09e%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/F0B254D2-C7F9-466E-92F6-C6A9A0FF8EDD%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
this is actually a C# code.

var httpclient = new HttpClient();
url = "http://somewebsite.com/server.py";
parameters = new Dictionary<string,string>{
                {"cmd", "webnotes.client.set_value"},
                {"doctype", "Profile"},
                {"docname", "Administrator"},
                {"fieldname", "new_password"},
                {"value", "syedx"}
                
             };
             
var serverResponse = httpclient.PostAsync(new Uri(url), new FormUrlEncodedContent(parameters)).Result;

var result = Encoding.UTF8.GetString(serverResponse.Content.ReadAsByteArrayAsync().Result);



and the result contains that redirection error.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/b05e858d-37cf-4621-8fee-2531f0a72a4f%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
ok guys sorry, it seems the issue was with my code.

its working fine,

thanks.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/36541afd-365a-4095-8aba-f09d0c283b28%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.